import request from '@/utils/request'
import {jsonService} from '@/utils/requestType'

//登录
export const login = (username,password) => {
	var params = new URLSearchParams();
	params.append('username', username);
	params.append('password', password);
	return request({
		url: 'login',
		method: 'post',
		params: params
	})
}
//发送验证码
export const sendCodeToEmail = (email) => {
	var params = new URLSearchParams();
	params.append('email', email);
	return request({
		url: '/sendCodeToEmail',
		method: 'post',
		params: params
	})
}
//注册
export const register = (data,code) => {
	return jsonService({
		url: '/register/'+code,
		data: data
	})
}